<template>
  <div>
    <MyHeader :background="'pink'" title="TabBar案例"></MyHeader>
    <div class="main">
      <!-- <router-link to="/mytable/mygoodslist"></router-link>
      <router-link to="/mytable/mygoodssearch"></router-link>
      <router-link to="/mytable/myuserinfo"></router-link> -->
      <!-- <component :is="comName">
        
      </component> -->
      <router-view ></router-view>
    </div>
    <!-- 给子传list  自定义事件名，为子传父做准备 -->
    <MyTabBar :list="tabList"></MyTabBar>
  </div>
</template>

<script>
import MyHeader from "./components/MyHeader";
import MyTabBar from "./components/MyTabBar.vue";
import MyGoodsList from "./views/MyGoodsList.vue";
import MyGoodsSearch from "./views/MyGoodsSearch.vue";
import MyUserInfo from "./views/MyUserInfo.vue";
export default {
  components: {
    MyTabBar,
    MyHeader,
    MyGoodsList,
    MyGoodsSearch,
    MyUserInfo,
  },
  data() {
    return {
      comName: "MyGoodsList",
      tabList: [
        {
          iconText: "icon-shangpinliebiao",
          text: "商品列表",
          componentName: "MyGoodsList",
        },
        {
          iconText: "icon-sousuo",
          text: "商品搜索",
          componentName: "MyGoodsSearch",
        },
        {
          iconText: "icon-user",
          text: "我的信息",
          componentName: "MyUserInfo",
        },
      ],
    };
  },
  // methods: {
  //   // 点击切换组件
  //   activeFn(cName) {
  //     this.comName = cName;
  //   },
  // },
};
</script>

<style scoped>
.main {
  padding-top: 45px;
  padding-bottom: 51px;
}
</style>